package com.leyou.search.controller;

import com.leyou.search.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author GL160601@163.com
 * @date 2020/12/13 19:50
 */

@Service
@RequestMapping("/index")
public class IndexController {

    @Autowired
    private IndexService indexService;
    @GetMapping("/init")
    public ResponseEntity<String> initIndex() {
        this.indexService.loadData();
        return ResponseEntity.ok("索引库初始化完成!");
    }
}
